package com.ruoyi.ghxx.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectUtil {
    public static Connection getConnection() throws Exception{
        String driverName = "com.mysql.cj.jdbc.Driver";
        String dbURL = "jdbc:mysql://81.68.197.219:3306/wu_lian_yun_sc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
        String userName = "wu_lian_yun_sc";
        String userPwd = "wu_lian_yun_sc";
        Connection dbConn = null;
        Class.forName(driverName);
        System.out.println("连接数据库成功");
        dbConn=DriverManager.getConnection(dbURL, userName, userPwd);
        return dbConn;
    }
}
